package edu.scau.sku.domain;

import edu.scau.sku.vo.SkuVo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.io.Serializable;

/**
 * (Sku)实体类
 *
 * @author hwh
 * @since 2025-03-22 14:05:09
 */

@Tag(name = "库存表", description = "库存domain")
@Data
@Component
public class Sku implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(name = "skuId", description = "唯一自增标识", type = "Integer")
    private long skuId;

    @Schema(name = "skuCode", description = "库存编号，唯一标记", type = "String")
    private String skuCode;

    @Schema(name = "skuName", description = "库存名称", type = "String")
    private String skuName;

    @Schema(name = "stock", description = "库存量", type = "Integer")
    private int stock;

    @Schema(name = "status", description = "库存状态, 0:上架, 1:下架", type = "String")
    private String status;

    @Schema(name = "isDeleted", description = "删除标识,(0:未删除, 1:删除)", type = "String")
    private String isDeleted;

    @Schema(name = "createBy", type = "String")
    private String createBy;

    @Schema(name = "createTime", type = "Date")
    private Date createTime;

    @Schema(name = "updateBy", type = "String")
    private String updateBy;

    @Schema(name = "updateTime", type = "Date")
    private Date updateTime;



    public Sku() {
    }

    public Sku( long skuId,   String skuCode,   String skuName,   int stock,   String status,   String isDeleted,   String createBy,   Date createTime,   String updateBy,   Date updateTime ) {
        this.skuId = skuId;
        this.skuCode = skuCode;
        this.skuName = skuName;
        this.stock = stock;
        this.status = status;
        this.isDeleted = isDeleted;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
    }

    public Sku(SkuVo skuVo){
        this.skuId = skuVo.getSkuId();
        this.skuCode = skuVo.getSkuCode();
        this.skuName = skuVo.getSkuName();
        this.stock = skuVo.getStock();
        this.status = skuVo.getStatus();
    }
}
